{% extends 'base.html.twig' %}

 
{% block body %}
    <form action="{{ path('app_lucky_addproduct') }}" method="post">
        产品名称:<input type="text" name="name" value="Mickey">
        <br>
        产品价格:<input type="text" name="price" value="15.22">
        <br>
        产品描述:<input type="text" name="description" value="description">
        <br>
        <input type="submit" value="添加">
    </form>
    <h2 id="test" onclick="onClickButton()">测试 {{ luckyNumberList|length }}</h2>
    <h2>5555{{ request.method }}</h2>
    <h1>Example heading <span class="badge badge-default">New</span></h1>

    <div class="dropdown" style="">
        <button class="btn btn-secondary dropdown-toggle" type="button" id="dropdownMenuButton" data-toggle="dropdown"
                aria-haspopup="true" aria-expanded="false">
            Dropdown button
        </button>
        <div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
            <a class="dropdown-item" href="#">Action</a>
            <a class="dropdown-item" href="#">Another action</a>
            <a class="dropdown-item" href="#">Something else here</a>
        </div>
    </div>

    <ul>
        {% for item in luckyNumberList %}
            <li>{{ item }}</li>
        {% endfor %}
    </ul>
    {% image '@AppBundle/Resources/public/image/test2.jpg' %}
        <img src="{{ asset_url }}" alt="Example"/>
    {% endimage %}
    <button type="button" class="btn btn-primary">Primary</button>

{% endblock %}

{% block javascripts %}
    <script type="text/javascript">
        var list ={{ luckyNumberList|json_encode|raw }};
        console.log(list);
        var app ={{ app|json_encode|raw }};
        console.log(app);


        function onClickButton() {
            var array ={{ luckyNumberList|json_encode|raw }};
            console.log(array)
            $('#test').html("test");
        }
    </script>
{% endblock %}